package ${package_controller};
        <#if swagger==true>import io.swagger.annotations.*;</#if>


import com.lz.common.Enum.ResultEnum;
import com.lz.common.utils.JWTUtils;
import com.lz.common.utils.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * <pre>
 * @描述：${Table}的控制层接口
 * @作者：${NAME}
 * @创建时间： ${DATE}
 * </pre>
 **/
<#if swagger==true>@Api(tags = "${Table}Controller")</#if>
@RestController
@RequestMapping("/${serviceName}/${table}")
@CrossOrigin
public class ${Table}Controller {

    @Autowired
    private ${Table}Service ${table}Service;



    @GetMapping
    public Result<Object> demo1(@CookieValue(value = "token", defaultValue = "defaultValue") String token) {
        Integer id = JWTUtils.parseIdByToken(token);
        return ResultEnum.SUCCESS.toResponseResult();
    }

    @PostMapping
    public Result<Object> demo2(@CookieValue(value = "token", defaultValue = "defaultValue") String token) {
        Integer id = JWTUtils.parseIdByToken(token);
        return ResultEnum.SUCCESS.toResponseResult();
    }

    @PutMapping
    public Result<Object> demo3(@CookieValue(value = "token", defaultValue = "defaultValue") String token) {
        Integer id = JWTUtils.parseIdByToken(token);
        return ResultEnum.SUCCESS.toResponseResult();
    }

    @PatchMapping
    public Result<Object> demo4(@CookieValue(value = "token", defaultValue = "defaultValue") String token) {
        Integer id = JWTUtils.parseIdByToken(token);
        return ResultEnum.SUCCESS.toResponseResult();
    }

    @DeleteMapping
    public Result<Object> demo5(@CookieValue(value = "token", defaultValue = "defaultValue") String token) {
        Integer id = JWTUtils.parseIdByToken(token);
        return ResultEnum.SUCCESS.toResponseResult();
    }


}
